1. Field of the Invention
The present invention relates to an arithmetic-program conversion apparatus, an arithmetic-program conversion method, and a program capable of obtaining a hardware model program by converting an arithmetic program, such as an algorithm model program, etc.
2. Description of the Related Art
Japanese Unexamined Patent Application Publication No. 2001-43067 has disclosed an arithmetic apparatus capable of converting a numeric value from a floating-point notation to a fixed-point notation while keeping a loss of the number of significant digits to a minimum.
This arithmetic apparatus includes a maximum-exponent-part-value detection section, which interprets k-bit data stored in a storage section as floating-point data having an m-bit mantissa part and an n-bit exponent part, and detects a maximum value r of the exponent part of the data in a block.
And the arithmetic apparatus converts each data in the block into floating-point data, which is represented by a pair of a maximum value r of an exponent part and a mantissa part, and performs arithmetic processing on the mantissa part of the converted data by an arithmetic processing section.
Also, the arithmetic apparatus completes predetermined arithmetic processing on the data in the block, and converts each data into fixed-point data on the basis of the maximum value r before outputting the data to the outside.
Japanese Unexamined Patent Application Publication No. 2002-149397 has disclosed a method of generating fixed-point data, which allows improving a bit decoding rate while reducing the size of a circuit.
In this method, maximum floating-point data is detected among floating-point data, and the difference between an exponent-part value of floating-point data and that of the maximum floating-point data is obtained.
Next, in this method, a mantissa part of the floating-point data is shifted by the difference, and a predetermined number of bits of the shifted mantissa part are extracted as fixed-point data.
In this manner, in a hardware circuit system, various kinds of variables to be arithmetically processed are subjected to arithmetic processing as fixed-point variables (variables having fixed bit widths) even if the variables are in a floating-point notation.